import request from '@/utils/request'
import Cookies from 'js-cookie'
// 分页
export function getPage(data) {
    return request({
        url: '/Statistic_gift_inventory_changes/select_gift_inventory_change_page',
        method: 'post',
        data: data
    })
}

// 列表
export function getList(data, page) {
    return request({
        url: '/Statistic_gift_inventory_changes/select_gift_inventory_change/' + (page ? page : 1),
        method: 'post',
        data: data
    })
}

// 获取门店列表
export function getStoreList(data) {
    return request({
        url: '/General/get_store',
        method: 'post',
        data: data
    })
}

// 导出
export function getExport(data) {
    // return request({
    //     url: `/Statistic_gift_inventory_changes/select_gift_inventory_change_getexcel`, //ajax返回的是字节流无法直接下载，需要打开网页
    //     method: 'GET',
    //     data,
    //     params: data
    // })
    window.location.href = `https://${location.host}/smsi/index.php/Statistic_gift_inventory_changes/select_gift_inventory_change_getexcel?store_id=${data.store_id}&begin_time=${data.begin_time}&end_time=${data.end_time}&gift_id=${data.gift_id}&didixueshengka=${Cookies.get('SMS_AdminToken')}`; 
}